<div class="modal" ng-controller="DeleteAppDefinitionPopupCtrl">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <h2>{{ 'APP.POPUP.DELETE-TITLE' | translate }}</h2>
      </div>
      <div class="modal-body">
        <p>{{ 'APP.POPUP.DELETE-DESCRIPTION-WITH-RUNTIME' | translate: model.app }}</p>

        <div class="form-group" ng-if="model.app.version != 1 && model.app.createdBy == account.id">
          <div class="radio" ng-click="popup.cascade = 'false'">
            <input ng-model="popup.cascade" value="false" type="radio" name="cascadeDelete" />
            <strong style="cursor:pointer">{{ 'APP.POPUP.DELETE-CASCADE-FALSE' | translate: model.app }}</strong>
          </div>
          <div class="radio" ng-click="popup.cascade = 'true'">
            <input ng-model="popup.cascade" value="true" type="radio" name="cascadeDelete" />
            <strong style="cursor:pointer">{{ 'APP.POPUP.DELETE-CASCADE-TRUE' | translate }}</strong>
          </div>
        </div>
      </div>
      <div class="modal-footer">
        <div class="pull-right">
          <button type="button" class="btn btn-sm btn-default" ng-click="cancel()" ng-disabled="popup.loading">
            {{ 'GENERAL.ACTION.CANCEL' | translate }}
          </button>
          <button
            type="button"
            class="btn btn-sm btn-danger"
            ng-click="ok()"
            ng-disabled="popup.loading || !model.app.name"
          >
            <span>{{ 'APP.ACTION.DELETE-CONFIRM' | translate }}</span>
          </button>
        </div>
        <div class="loading pull-right" ng-show="popup.loading">
          <div class="l1"></div>
          <div class="l2"></div>
          <div class="l2"></div>
        </div>
      </div>
    </div>
  </div>
</div>
